package com.ss.jdk.stream;

import java.util.stream.Stream;

/**
 * @Auther: ljy.s
 * @Date: 2022/9/10 - 09 - 10 - 17:01
 */
public class StreamTest07ForEach {
    // 这是一个main方法，是程序的入口：
    public static void main(String[] args) {
        Stream<String> a1 = Stream.of("a1", "a2", "a3");
        a1.filter(s -> s.contains("a"))
                .forEach(System.out::println);
        System.out.println("---------------");
        Stream.of("a1", "a2", "a3").filter(s -> s.contains("a"))
                .forEach(System.out::println);
        System.out.println("---------------");
        Stream.of("a1", "a2", "a3").forEach(System.out::println);
    }
}
